package net.yzxc.utils.utils;

import lombok.Data;

@Data
public class SerialPortParameter {

    String serialPortName;
    Integer baudRate;// 波特率
    Integer dataBits = 8;// 数据位8
    Integer stopBits = 1;// 停止位1
    Integer parity = 0;// 校验位无

    public SerialPortParameter(String serialPortName){
        this.serialPortName = serialPortName;
    }

    public SerialPortParameter(String serialPortName, Integer baudRate){
        this.serialPortName = serialPortName;
        this.baudRate = baudRate;
    }

    public SerialPortParameter(String serialPortName, Integer baudRate, Integer dataBits){
        this.serialPortName = serialPortName;
        this.baudRate = baudRate;
        this.dataBits = dataBits;
    }
}
